package com.liner.homework.second;

import com.liner.homework.first.Point;

import java.util.Arrays;

public class Homework {
    public static void main(String[] args) {
        //1. String支持的正则表达式练习：matches()、replaceAll()、split()方法。
        String str = "java is not supported,java is supported";
        String regex = " ";
        if (str.matches(regex)) {
            System.out.println("找到匹配项");
        }

        String s = str.replaceAll(regex, "~~~");
        System.out.println("替换后的str:" + s);
        String[] split = s.split("~");
        System.out.println("数组分割后的结果:" + Arrays.toString(split));


        // 2. Object的练习：设计Point类，体会重写toString()与equals()的必要性
        Point point1 = new Point(100, 321);
        Point point2 = new Point(100, 321);
        System.out.println("体会equals的必要性:" + point1.equals(point2));
        System.out.println("体会toString的必要性:" + point2.toString());

        // 3. 包装类的练习：演示包装类与基本类型的互转、演示自动拆装箱、演示包装类的两个常用操作
        Double d1 = new Double(12.43);
        double d2 = d1.doubleValue();

        Integer i1 = 12;

        String s1 = "86923";
        Integer integer = Integer.valueOf(s1);
        System.out.println("byte的最大值:" + Byte.MAX_VALUE);
        System.out.println("byte的最小值:" + Byte.MIN_VALUE);


    }


}
